<?php
// +----------------------------------------------------------------------
// | OneKeyAdmin [ Believe that you can do better ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020-2023 http://onekeyadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: MUKE <513038996@qq.com>
// +----------------------------------------------------------------------
namespace plugins\cms\api\validate;

use think\Validate;

class News extends Validate
{
    protected $rule = [
        'id'            => 'require|number',
        'pid'           => 'require|number',
        'page'          => 'require|number',
        'status'        => 'number',
        'catalog_id'    => 'number',
        'reply_user_id' => 'require|number',
        'content'       => 'require',
        'user_id'       => 'require',
    ];
    
    protected $scene = [
        'index'               => ['page','catalog_id','status'],
        'single'              => ['id','catalog_id'],
        'delete'              => ['id'],
        'isCollect'           => ['id', 'user_id'],
        'commentIndex'        => ['id','page'],
        'commentReply'        => ['id','page'],
        'userCommentIndex'    => ['page'],
        'userCommentSave'     => ['id','pid','reply_user_id','content'],
        'userCollectIndex'    => ['page'],
        'userCollectSave'     => ['id'],
        'userCommentLikeSave' => ['id'],
    ];
}